#include <stdio.h>
int main()
{
     int num;
     scanf("%d",&num);
     int reverse=0;
     int binnum=0;
     int temp=num;
     while(temp!=0)
     {
     	reverse+=reverse*10+temp%2;
     	temp=temp/2;
	 }
	 while(reverse!=0)
	 {
	 	binnum+=binnum*10+reverse%10;
	 	reverse/=10;
	 }
	 printf("%d",reverse);
	 return 0;
}
